<template>
    <div class="config-option">
        <span class="option-title">{ title }</span>
        <span class="input-txt" v-if="!editing">{{ '黄金' }}<i class="el-icon-edit"  v-if="!editing" @click="editing = true"></i></span>
        <div v-else>
            <el-select v-model="value1" size="mini" v-if="editType === 'select'" style="width: 100px;" @change="selectChange" placeholder="请选择">
                <el-option v-for="(item, index) in selectList" :key="index" :label="item.label" :value="item.value"></el-option>
            </el-select>
            <el-input @keyup.enter.native="selectChange" v-if="editType === 'input'" size="mini" v-model.trim="value1" placeholder="请选择" style="width: 100px;"></el-input>
        </div>
        <i class="el-icon-success" v-if="editing" @click="identitySave"></i>
        <i class="el-icon-error" v-if="editing" @click="identityCancel"></i>
    </div>
</template>

<script>
export default {
    name: 'editConfig',
    props: {
        title: {
            type: String,
            default: ''
        },
        editType: {
            type: String,
            default: 'select'
        },
        selectList: {
            type: Array,
            default: []
        }
    },
    data () {
        return {
            editing: false
        }
    },
    created () {
    },
    methods: {
        selectChange () {
        }
    }
}
</script>

<style lang="scss">
    .config-option {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        padding-left: 26px;
        color: #9B9A9A;
        .option-title {
            width: 100px;
            margin-right: 60px;
            font-size: 14px;
        }
        .option-tips {
            margin-left: 35px;
            font-size: 12px;
        }
        .input-title {
            margin-left: 20px;
        }
        .input-txt {
            font-size: 12px;
            color: rgba($color: #000000, $alpha: 0.6);
        }
        .btn {
            margin-top: 10px;
            margin-left: 10px;
        }
        i {
            margin-left: 5px;
            font-size: 14px;
            color: #409EFF;
            cursor: pointer;
        }
    }
</style>
